package L1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class _044 {
    /**
     * 稳赢
     */
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int K = Integer.valueOf(reader.readLine());
        String line = reader.readLine();
        int count =0;
        while (!line.equals("End")){
            if (count==K){
                System.out.println(line);
                count=0;
            }else if (line.equals("ChuiZi")){
                System.out.println("Bu");
                count++;
            }else if (line.equals("JianDao")){
                System.out.println("ChuiZi");
                count++;
            }else {
                System.out.println("JianDao");
                count++;
            }
            line = reader.readLine();
        }
    }
}
